/*
 * @Author: canlong.shen
 * @Date: 2021-10-28 11:05:14
 * @LastEditors: your name
 * @LastEditTime: 2021-11-01 14:56:33
 * @Description: file content
 */

import Vuex from 'vuex'

const moduleA = {
    namespaced: true,
    modules: {
        "a-1": {
            namespaced:true,
            state: () => ({ aState: "a-1" }),
            getters: {
                a1Get(state) {
                    return "a-1-get"
                }
            }
            
        }
    },
    state: () => ({
        aState:"aState"
    }),
    mutations: {
        addAState(state) {
            console.log("addAState", state)
            state.aState += 1
        }
    },
    actions: {
        triggerAddAState() {
            console.log("triggerAddAState")
        }
    },
    getters: {
        aGet(state) {
            return "aGet" 
        }
    }
    

}
const moduleB  = {
    state: () => ({
        bState:'bState'
    }),
    mutations: {

    },
    actions: {

    },
    getters: {

    }

}

export default function createStore() {
    return new Vuex.Store({
        modules: {
            a: moduleA,
            b: moduleB
        },
        state: {
            count: 100
        }
    })
}

